# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-other
pkgname=kommit
pkgver=1.3.1
pkgrel=0
pkgdesc="Git GUI client for KDE"
url="https://apps.kde.org/kommit/"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
license="GPL-3.0-or-later"
makedepends="
	extra-cmake-modules
	dolphin-dev
	kconfigwidgets-dev
	kcoreaddons-dev
	kcrash-dev
	kdbusaddons-dev
	kdoctools-dev
	ki18n-dev
	kio-dev
	ktexteditor-dev
	ktextwidgets-dev
	kxmlgui-dev
	libgit2-dev
	qt6-qtbase-dev
	samurai
	syntax-highlighting-dev
	"
checkdepends="xvfb-run"
subpackages="$pkgname-doc $pkgname-lang"
_repo_url="https://invent.kde.org/sdk/kommit.git"
#source="https://download.kde.org/stable/kommit/kommit-$pkgver.tar.xz"
source="https://invent.kde.org/sdk/kommit/-/archive/v$pkgver/kommit-v$pkgver.tar.gz"
options="net" # net required for tests
builddir="$srcdir/$pkgname-v$pkgver"

build() {
	cmake -B build -G Ninja \
		-DBUILD_WITH_QT6=ON \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	xvfb-run -a ctest --test-dir build --output-on-failure -E "(clone|index|config|submodule|clonedialog)test"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
b7aafa0285e6876f84dad71ae7d195e76f23fed718fa3f4d3b9f5a948455335c8093445a1ca0272220b6c81365e28ceb309cfef3cdb2cea129454a3359ad6005  kommit-v1.3.1.tar.gz
"
